//

var lis = document.getElementById('turnoverList').querySelectorAll('.openMonth');
var lisCat = document.getElementById('turnoverList').querySelectorAll('.openCategory');

for (var i = 0; i < lis.length; i++) {
    var li = lis[i];

    li.onclick = function(e) {
        e.preventDefault();
        var el = this.nextElementSibling;

        if (!el) return;

        if (el.className === 'category') {
            el.className = 'category category-open';
        } else {
            el.className = 'category';
        }
    };  
}


for (var j = 0; j < lisCat.length; j++) {
    var liCat = lisCat[j];

    liCat.onclick = function(e) {
        e.preventDefault();
        var el = this.nextElementSibling;

        if (!el) return;

        if (el.className === 'fold') {
            el.className = 'fold fold-open';
        } else {
            el.className = 'fold';
        }
    };  
}




